
<template>
  <div class="card-body">
    <table border="1" class="vant-table">
      <thead>
        <tr v-for="item in headData">
          <th class="header-level-1" v-for="itemIn in item" :colspan="itemIn.cols" :rowspan="itemIn.rows">{{ itemIn.value }}</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, index) in bodydata" :key="index">
          <td v-for="itemI in item">{{ itemI.value }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script setup lang="ts">
import { ref, defineProps } from 'vue'

const props = defineProps({
  headData: {
    type: Array,
    default: []
  },
  bodydata: {
    type: Array,
    default: []
  }
})
const Thead = ref([])

Thead.value = props.headData
</script>
<style scoped>

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: #1989fa;
  font-weight: 600;
}

.header p {
  color: #646566;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(25, 137, 250, 0.15);
  overflow: hidden;
  margin-bottom: 30px;
}

.card-body {
  padding: 0;
  overflow-x: auto;
}

/* Vant风格表格 */
.vant-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  font-size: 14px;
}

.vant-table th {
  background-color: #f7f8fa;
  color: #323233;
  font-weight: 600;
  text-align: center;
  padding: 14px 12px;
  border-bottom: 1px solid #fff;
  position: relative;
}

.vant-table th:not(:last-child) {
  border-right: 1px solid #fff;
}

.vant-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #fff;
  text-align: center;
  border: 1px solid #e8eaec
}


.vant-table tr:last-child td {
  border-bottom: none;
}

.header-level-1 {
  min-width: 120px;
  background-color: #e0edff !important;
  font-size: 15px;
  color: #1989fa;
}
  .header h1 {
    font-size: 1.8rem;
  }

  .card {
    border-radius: 12px;
  }

  .vant-table {
    font-size: 13px;
  }

  .vant-table th,
  .vant-table td {
    padding: 10px 8px;
  }
</style>
